window.onload=function (){
    document.querySelector(".loginbtn").onclick=function (){

        username = document.querySelector(".loginuser").value;
        password = document.querySelector(".loginpwd").value;
        axios({
            method: 'get',
            url: '/ConsumerController/'+username+'/'+password
        }).then(function (resp) {
            //成功跳转到HomePage.html
            if (resp.data.data){
                sessionStorage.setItem("userid",username);
                sessionStorage.setItem('isLogined','true');
                window.location.href="../HomePage.html";
            }else {
                sessionStorage.setItem("FailureReason","LoginFailure");
                window.location.href="../Failure.html";
            }

        });
    }
}